package cn.iocoder.yudao.module.moa.dal.mysql.qjapply;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.moa.dal.dataobject.qjapply.QjApplyDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.moa.controller.admin.qjapply.vo.*;

/**
 * MOA 请假申请 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface QjApplyMapper extends BaseMapperX<QjApplyDO> {

    default PageResult<QjApplyDO> selectPage(QjApplyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QjApplyDO>()
                .eqIfPresent(QjApplyDO::getOwnerUserId, reqVO.getOwnerUserId())
                .eqIfPresent(QjApplyDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .eqIfPresent(QjApplyDO::getAuditStatus, reqVO.getAuditStatus())
                .eqIfPresent(QjApplyDO::getQjzxs, reqVO.getQjzxs())
                .eqIfPresent(QjApplyDO::getQjsy, reqVO.getQjsy())
                .eqIfPresent(QjApplyDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(QjApplyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QjApplyDO::getId));
    }

}